import 'package:flutter/material.dart';

const description = "Lake Oeschinen lies at the foot of the Blüemlisalp in the Bernese Alps. Situated 1,578 meters above sea level, it is one of the larger Alpine Lakes. A gondola ride from Kandersteg, followed by a half-hour walk through pastures and pine forest, leads you to the lake, which warms to 20 degrees Celsius in the summer. Activities enjoyed here include rowing, and riding the summer toboggan run.";

class TitleSection extends StatelessWidget {
  const TitleSection({ super.key });

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: const Padding(
        padding: EdgeInsets.all(32.0),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Expanded(
              child: Column(
                children: [
                  Padding(
                    padding: EdgeInsets.only(bottom: 8.0),
                    child: Text(
                      "Oeschinen Lake Campground",
                      style: TextStyle(
                        color: Colors.black87,
                        fontSize: 16.0,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                  ),

                  Text(
                    "Kandersteg, Switzerland",
                    style: TextStyle(
                      color: Colors.grey,
                      fontSize: 14.0,
                    ),
                  ),
                ],
              ),
            ),

            Icon(Icons.star, color: Colors.red),

            Text("41", style: TextStyle(fontSize: 16.0, color: Colors.black87),),
          ],
        ),
      ),
    );
  }
}

class CustomButton extends StatelessWidget {
  const CustomButton({
    super.key,
    required this.icon,
    required this.color,
    required this.text,
  });

  final IconData icon;
  final Color color;
  final String text;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Icon(icon, color: color),
        Text(
          text,
          style: TextStyle(
            fontSize: 16.0,
            color: color,
          ),
        )
      ],
    );
  }
}

class LayoutWidget extends StatelessWidget {
  const LayoutWidget({ super.key });

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: SingleChildScrollView(
        child: Column(
          children: [
            Image.asset(
              "images/lake.jpeg",
              width: 600.0,
              height: 400.0,
              fit: BoxFit.cover,
            ),

            const TitleSection(),

            const Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                CustomButton(
                  icon: Icons.call,
                  color: Colors.deepPurple,
                  text: "CALL"
                ),
                CustomButton(
                  icon: Icons.near_me,
                  color: Colors.deepPurple,
                  text: "ROUTE"
                ),
                CustomButton(
                  icon: Icons.share,
                  color: Colors.deepPurple,
                  text: "SHARE"
                )
              ],
            ),

            const Padding(
              padding: EdgeInsets.all(16.0),
              child: Text(
                description,
                softWrap: true,
                style: TextStyle(
                  fontSize: 14.0,
                  color: Colors.black87,
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}